/**
 * 
 */
package org.cuatrovientos.hellokitty;

import java.util.Vector;

/**
 * Represents a basjet full or not of food.
 * @author daniel_ancin
 *
 */
public class Basket {
	private Vector <Food> foods;
	
	/**
	 * 
	 */
	
	public Basket(){
		foods = new Vector<Food>();
		
		
	}
	
	public void insertFood (Food food){
		foods.add(food);
	}
	
	/**
	 * gives total weight of content
	 * @return
	 */
	public float totalWeight() {
		float total =0;
		
		for (int i=0; i< foods.size();i++){
			total =total + foods.get(i).getWeight();
			
		}
		
		return total;
		
	}
	
	/**
	 * returns a String whit food data
	 * @return food data
	 */
	
	public String toString (){
		
		String result ="";
		
		//for each
		for (Food food : foods){
			result = result + food.toString() + "\n";
						
		}
		return result;
	}
	

}
